$(function () {
    // 设置账号密码的可见性
    function visable1() {
        $this.removeClass("glyphicon-eye-open");
        $this.addClass("glyphicon-eye-close");
        $this.parent().next().children().attr("type","password")
    }

    function visable2() {
        $this.removeClass("glyphicon-eye-close");
        $this.addClass("glyphicon-eye-open");
        $this.parent().next().children().attr("type","text")
    }

    var flag = 0;

    $(".form-group label i").on("click",function () {
        $this = $(this);
        if(flag == 0){
            visable1();
            flag = 1;
        }else {
            visable2();
            flag = 0;
        }
    });

});